#define _CRT_SECURE_NO_WARNINGS 1
#include "SeqList.h"

void test1()
{
	SeqList SL;
	SeqList* ps = &SL;
	SeqListInit(ps);
	
	SeqListPushBack(ps, 1);
	SeqListPrint(ps);
	SeqListPushBack(ps, 2);
	SeqListPrint(ps);
	SeqListPushBack(ps, 3);
	SeqListPrint(ps);
	SeqListPushBack(ps, 4);
	SeqListPrint(ps);

	SeqListDestroy(ps);
}

void test2()
{
	SeqList SL;
	SeqList* ps = &SL;
	SeqListInit(ps);

	SeqListPushFront(ps, 1);
	SeqListPushFront(ps, 2);
	SeqListPushFront(ps, 3);
	SeqListPushFront(ps, 4);
	SeqListPrint(ps);

	SeqListPopFront(ps);
	SeqListPrint(ps);
	SeqListPopFront(ps);
	SeqListPrint(ps);
	SeqListPopFront(ps);
	SeqListPrint(ps);
	SeqListPopFront(ps);
	SeqListPrint(ps);

	SeqListDestroy(ps);
}

void test3()
{
	SeqList SL;
	SeqList* ps = &SL;
	SeqListInit(ps);

	SeqListPushFront(ps, 1);
	SeqListPushFront(ps, 2);
	SeqListPushFront(ps, 3);
	SeqListPushFront(ps, 4);
	SeqListPrint(ps);

	SeqListPopBack(ps);
	SeqListPrint(ps);
	SeqListPopBack(ps);
	SeqListPrint(ps);
	SeqListPopBack(ps);
	SeqListPrint(ps);
	SeqListPopBack(ps);
	SeqListPrint(ps);

	SeqListDestroy(ps);
}

void test4()
{
	SeqList SL;
	SeqList* ps = &SL;
	SeqListInit(ps);

	SeqListPushFront(ps, 1);
	SeqListPushFront(ps, 2);
	SeqListPushFront(ps, 3);
	SeqListPushFront(ps, 4);
	SeqListInsert(ps, 2, 6);
	SeqListInsert(ps, 0, 6);
	SeqListInsert(ps, 6, 6);
	SeqListPrint(ps);

	SeqListErase(ps, 1);
	SeqListPrint(ps);
	SeqListErase(ps, 1);
	SeqListPrint(ps);
	SeqListErase(ps, 3);
	SeqListPrint(ps);
	SeqListErase(ps, 1);
	SeqListPrint(ps);
	SeqListErase(ps, 2);
	SeqListPrint(ps);
	SeqListErase(ps, 1);
	SeqListPrint(ps);
	SeqListErase(ps, 0);
	SeqListPrint(ps);

	SeqListDestroy(ps);
}

int main()
{
	test4();
	return 0;
}